<html>
<!-- 
  Copyright 2010 Scott Logic Ltd.
  http://www.scottlogic.co.uk
  
  This file is part of Closure Charts.

  Closure Charts is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Closure Charts is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with Closure Charts.  If not, see <http://www.gnu.org/licenses/>.
-->
<head>
<title>JavaScript Charting Unit Tests - Axis</title>
<script type="text/javascript" src="../../../../../../../../closure-library/src/main/webapp/js/goog/base.js"></script>
<script type="text/javascript" src="../unitTestDependencies.js"></script>
<script>
    goog.require('goog.testing.jsunit');

    goog.require('goog.dom');
    goog.require('scottlogic.chart.rendering.NumericalAxis');
    goog.require('scottlogic.chart.rendering.DateTimeAxis');

</script>
</head>
<body>
<script>  
    // Clear the canvas after the charts have been tested
    function tearDown(){
        var canvas = goog.dom.$('canvas');
        canvas.innerHTML = '';
    }

    function testNullFormatter(){
        var x = new scottlogic.chart.rendering.NumericalAxis();
        
        assertNull("Formatter is null", x.formatter_);
        assertEquals("Label correctly generated", "5", x.getLabel(5));
        
        var min = new goog.date.UtcDateTime(2010, 4, 3, 3, 4, 2, 3);
        var max = new goog.date.UtcDateTime(2010, 5, 4, 3, 2, 4, 3);
        var x = new scottlogic.chart.rendering.DateTimeAxis();
        x.setMinimum(min);
        x.setMaximum(max);
        assertNull("Formatter is null", x.formatter_);
        console.log(x);
        assertEquals("Label correctly generated", "19700101T000000", x.getLabel(1));
    }
   
</script>
<div id="canvas"></div>
</body>
</html>
